package com.jxs.tourist.service.impl;

import com.jxs.tourist.dao.UserDao;
import com.jxs.tourist.domain.User;
import com.jxs.tourist.domain.UserListBean;
import com.jxs.tourist.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    public UserServiceImpl() {
        System.out.println("UserServiceImpl");
    }

    public int insert(User user) {
        return userDao.insert(user);
    }

    public User selectByUserId(int id) {
        return userDao.selectByUserId(id);
    }

    public User selectByPrimaryKey(String account) {
        return userDao.selectByPrimaryKey(account);
    }

    public List<UserListBean> getAllUser(int actype) {
        return userDao.getAllUser(actype);
    }

    public int editPassword(User user) {
        return userDao.editPassword(user);
    }

    public int deleteAdmin(int id) {
        return userDao.deleteAdmin(id);
    }
}
